package com.zzzyh.forumsystemclient.cotroller;

import com.zzzyh.forumsystemclient.common.AppResult;
import com.zzzyh.forumsystemclient.model.Tag;
import com.zzzyh.forumsystemclient.services.ITagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/tag")
public class TagController {

    @Autowired
    private ITagService tagService;

    @RequestMapping("/list")
    public AppResult<List<Tag>> list(){
        List<Tag> tags = tagService.list();
        return AppResult.success(tags);
    }
}
